<%-- 
    Document   : abc_cliente
    Created on : 20-oct-2011, 23:34:08
    Author     : Yojugracu
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id = "conectar" scope = "application" class= "Monetario.ManipulacionMysql"/>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">


    <div id="clientes" class="paso2_cuenta">
  <div id="step-holder">

      </div>
<table border="0" width="50%" cellpadding="0" cellspacing="0" id="busqueda-table">
               <tr>
                    <th valign="top">Buscar:</th>
                    <td>
                    <select id="busqueda" class="styledselect_form_1">
                            <option value="TODOS">TODOS</option>
                            <%
                                for(int i =65;i<91;i++){
                                    String aChar = new Character((char)i).toString();
                                    out.println("<option value=\""+aChar+"\">"+aChar+"</option>");
                                }

                            %>
                    </select>
                    </td>
                    <td></td>
                </tr>
</table>
<br><br><br>
        <%
        int inicio=0;
        int finals=1000;
        String busqueda=request.getParameter("busqueda");
        String busco[];
        if (busqueda.equalsIgnoreCase("TODOS")){
          out.println("Mostrando todos los clientes <br>");
          String search[]=conectar.get_ids(String.valueOf(inicio),String.valueOf(finals));
          busco=search;
          }
        else{
            out.println("Coincidencias con la letra  "+busqueda+"<br>");
            String search[]=conectar.get_ids_from_letter(String.valueOf(inicio),String.valueOf(finals),busqueda);
            busco=search;
        }

        %>

        <br><br><br>
            <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">

                <tr>

                        <th class="table-header-repeat line-left minwidth-1"><a href="">Apellido</a>	</th>
                        <th class="table-header-repeat line-left minwidth-1"><a href="">Nombre</a></th>
                        <th class="table-header-repeat line-left  minwidth-1"><a href="">Direccion</a></th>
                        <th class="table-header-repeat line-left  minwidth-1"><a href="">Fecha_Nac</a></th>
                        <th class="table-header-repeat line-left  minwidth-1"><a href="">Tipo_cliente</a></th>
                        <th class="table-header-repeat line-left  minwidth-1"><a href="">Tipo_cuenta</a></th>
                        <th class="table-header-repeat line-left  minwidth-1"><a href="">Id_cuenta</a></th>
                        <th class="table-header-repeat line-left  minwidth-1"><a href="">Estado_cuenta</a></th>
                        <th class="table-header-repeat line-left  minwidth-1"><a href="">Firma/foto</a></th>
                </tr>
                <%
                out.println("<tr class=\"alternate-row\">");
                for(int i=1;i<busco.length;i++){
                    String[] datos=conectar.get_datos_clientes(busco[i],getServletContext());
                    String uniqueid= java.util.UUID.randomUUID().toString();
                    if(((i-1)%2)==0)
                        out.println("<tr>");
                    else{
                        out.println("<tr class=\"alternate-row\">");

                    }
                        out.println("<td>"+datos[1]+"</td>");
                        out.println("<td>"+datos[0]+"</td>");
                        out.println("<td>"+datos[2]+"</td>");
                        out.println("<td>"+datos[3]+"</td>");
                        out.println("<td>"+datos[6]+"</td>");
                        out.println("<td>"+datos[7]+"</td>");
                        out.println("<td>"+datos[9]+"</td>");
                        out.println("<td>"+datos[8]+"</td>");
                        out.println("<td><a  onClick=\"ok_1('"+uniqueid+"');\">Firma/Foto</a></td>");
                        out.println("<div id=\""+uniqueid+"\" class=\"window\" style=\"display:none;\">");
                        out.println("<font  color=\"white\">");
                        out.println("<h3>Firma/Foto<h3><br/>");
                        out.println("&nbsp;&nbsp;&nbsp;");
                        out.println("<img src=\""+datos[4]+"\" width=\"150\" height=\"150\" alt=\"Firma\" border=\"3\">");
                        out.println("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;");
                        out.println("<img src=\""+datos[5]+"\" width=\"150\" height=\"150\" alt=\"Foto\" border=\"3\">");
                        out.println("</font></div>");
                        out.println("</tr>");
                }
                %>
            </table>
<br>
<br>
<br>

				<!--  end product-table................................... -->

      <table border="0" cellpadding="0" cellspacing="0"  id="id-form">
        <tr>
                <th>&nbsp;</th>
                <td valign="top">
                    <input type="button" value="" class="form-submit" Onclick="busqueda_clientes();" />
                    <input type="button" value="Nueva" class="form-reset" Onclick="crear_cuenta_regresar_1();" />

                </td>
                <td>
    <br>
    <br>

        </tr>
        </table>

    </div>